var editPaper = {
    close: function () {
        $("#editPaperWindow").remove();
    },
    checkForm: function () {
        var formObj = JWB.utils.fromSerialize($("#editPaperForm"));
        var flag = true;
        // if(formObj["paper.descr"] == "" ) {
        //     flag = false;
        //     $("[id=paperDescr]").parent().addClass("has-error");
        // }else {
        //     $("[id=paperDescr]").parent().removeClass("has-error");
        // }
        return flag;
    },
    save: function () {
        if (paper.checkForm() == true) {
            var url = base.basePath + "paper/save";
            var data = JWB.utils.fromSerialize($("#editPaperForm"));
            $.ajax(
                {
                    url: url,
                    data: data,
                    type: "POST",
                    success: function (res) {
                        alert(res.msg);
                        if (res.code == 0) {
                            editPaper.close();
                            index_js.reloadRightPage();
                        }
                    },
                    error: function (jXHR, textStatus, errorThrown) {
                        JWB.http.errorHandle(jXHR, textStatus, errorThrown);
                    }
                }
            );
        }
    }
}